package Controller.Eboard;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import Dao.eboardDao;

public class EboarddeleteContoller  implements Controller {
	private eboardDao dao;
	public void setDao(eboardDao dao){
		this.dao = dao;
	}

	@Override
	public ModelAndView handleRequest(HttpServletRequest request,
			HttpServletResponse arg1) throws Exception {
		// TODO Auto-generated method stub
		
		Integer delete = Integer.parseInt(request.getParameter("delete"));
		String eb_title = request.getParameter("eb_title");
		System.out.println(eb_title);
		System.out.println(delete);
		dao.ebdelete(delete);
		
		ModelAndView mav = new ModelAndView();
		mav.setViewName("redirect:/eboardmain.eboard");
		return mav;
	}
}